import 'package:flutter/material.dart';

class BottomNavigaitonBarDemo extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _BottomNavigationBarDemoState();
  }
}

class _BottomNavigationBarDemoState extends State<BottomNavigaitonBarDemo> {
  int _currentIndex = 0;
  void _onTapHandle (int index) {
    setState(() {
      _currentIndex = index;
    });
  }
  @override
  Widget build(BuildContext context) {
    return BottomNavigationBar(
        currentIndex: _currentIndex,
        onTap: _onTapHandle,
        type: BottomNavigationBarType.fixed,
        fixedColor: Colors.pink,
        items: [
          BottomNavigationBarItem(
            icon: Icon(Icons.list),
            label: 'list' 
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.explore),
            label: 'Explore'
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.history),
            label: 'history'
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.person),
            label: 'person' 
          ),
        ],
      );
  }
}

